package org.nfIt.controller;

import org.nfIt.dto.order.OrderStatisticsDto;
import org.nfIt.service.OrderInfoService;
import org.nfIt.vo.common.Result;
import org.nfIt.vo.common.ResultCodeEnum;
import org.nfIt.vo.order.OrderStatisticsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClossName:OrderInfoController
 * Pakage:org.nfIt.controller
 * Description
 *
 * @Author L
 * @Create 2024/9/10 19:38
 * @Version 2023.1.3
 */
@RestController
@RequestMapping(value="/admin/order/orderInfo")
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService ;

    /**
     *DTO - 封装传过来的数据
     * VO - 封装返回结果
     *
     *实现Echarts图表显示
     * @param orderStatisticsDto 封装传过来的数据
     */
    @GetMapping("/getOrderStatisticsData")
    public Result<OrderStatisticsVo> getOrderStatisticsData( OrderStatisticsDto orderStatisticsDto) {
        OrderStatisticsVo orderStatisticsVo = orderInfoService.getOrderStatisticsData(orderStatisticsDto) ;
        return Result.build(orderStatisticsVo , ResultCodeEnum.SUCCESS) ;
    }

}
